package com.zircloud.user.service.impl;

import com.zircloud.user.dao.entity.User;
import com.zircloud.user.dao.mapper.UserMapper;
import com.zircloud.user.dto.UserDto;
import com.zircloud.user.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author test
 * @since 2021-12-24
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
	
	
	@Autowired
	private UserMapper mapper;

	@Override
	public UserDto getUserById(Integer id) {
		User user = mapper.selectById(id);
		if(user!=null) {
			UserDto dto = new UserDto();
			BeanUtils.copyProperties(user, dto);
			return dto;
		}
		return null;
	}

}
